import React from "react"
import { observer, inject } from "mobx-react"

interface IAppProps {
  rootStore?: any
  history?: any
}

interface IAppState {}

@inject("rootStore")
@observer
export class App extends React.Component<IAppProps, IAppState> {
  componentDidMount() {
    console.log(this)
  }

  render() {
    const { loginStore } = this.props.rootStore
    const { history } = this.props

    return (
      <div className="App">
        <div className="loginDiv" onClick={() => loginStore.login()}>
          登录
        </div>
        <div onClick={() => history.push("/mine")}>跳转个人中心</div>
      </div>
    )
  }
}

export default App
